|
|
|
|
|
|
|
SizeControls picSplitter.Left |
|
|
|
|
|
|
|
|
If you use Step Into, the Code window jumps to the SizeControls procedure and sets the first executable statement in that procedure to the current statement. This enables you to analyze the code with the SizeControls procedure. However, when using the Step Over command, the Code window continues to display the current procedure. Execution then moves to the statement immediately after the call to SizeControls, unless the procedure contained a breakpoint or Stop statement. Step Over is used if you don't need to analyze the SizeControls procedure, but want to continue single-stepping though the code. |
|
|
|
|
|
|
|
|
By using the Step Into and Step Over commands together, you can single-step through the application. Then, when you arrive at a procedure call you can choose to either follow the execution into the call or step over it and stop at the statement after the procedure was processed. To see the difference between the commands, stop the Address Book application and set a breakpoint at the beginning of the frmMain's Form_Load routine. Now, execute the application and when you are stopped at the breakpoint, single-step the code by pressing F8 until you get to the call to the Set_NewTree procedure. First, try stepping into the procedure. Then, quit the application and restart it. This time when you get to the breakpoint, single-step to the procedure call and then try the Step Over command by pressing Shift+F8 to see how Visual Basic processes these commands. |
|
|
|
|
|
|
|
|
The third step command is the Step Out command. This command is similar to the Step Into and Step Over commands, except that it will execute the remainder of the code in the current procedure. If the procedure was called from another procedure, it will continue execution until it gets to the statement immediately following the one that called the procedure. Once again, restart the Address Book application and this time Step Into the Set_NewTree procedure being called. Now press Ctrl+Shift+F8 to perform a Step Out command. You should now be stopped at the statement immediately after the procedure call. |
|
|
|
|
|
|
|
|
While you are stepping through the application code, you will undoubtedly encounter process loops or long sections of plain, boring code that you don't want to step through. To dynamically step over this code, you can use the Run To Cursor command to select a statement further down in your code where you want to stop the execution of the code. In the Address Book application, place the cursor on a statement a few lines further down from where you are stopped. By pressing the Ctrl+F8 keys, you will bypass the code between the cursor and the statement where the code was stopped. |
|
|
|
|
|
|
|
|
Last but not least is the capability to change the pointer to the next executable statement. Visual Basic enables you to set a different line of code to execute, provided it falls within the current procedure. The effect is similar to using Step Into, except Step Into exe- |
|
|
|
|
|